<?php use_javascript('invoice')?>
<?php use_javascript('debitMemo')?>
<div class="module_title">Debit Memo</div>
<div id="debitMemoMenuBar" class="menu_bar">
  <?php echo link_to('New','invoice/search',array('id'=>'debitMemoMenuItemNew','class'=>'menu_unselected',));?>
  <?php echo link_to('Search', 'debitMemo/search',array('class'=>'menu_unselected','id'=>'debitMemoMenuItemSearch',))?>
</div>
<div id="<?php echo sfConfig::get('app_windows_main_id')?>" class="<?php echo sfConfig::get('app_windows_main_class')?>">
</div>

<script language="javascript">
  $(document).ready(
    function(){
      $('#debitMemoMenuItemNew').click(
        function(e){
          menuSelect("#debitMemoMenuBar",this);
          $.get(this.href,{},
            function(content){
              invoiceDialogMode=10;
              $("#ajMain").html(content);
            }
          );
          e.preventDefault();
        }
      );
      $('#debitMemoMenuItemSearch').click(
        function(e){
          menuSelect("#debitMemoMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").html(content);
            }
          );
          e.preventDefault();
        }
      );
    }
  );
</script>